package com.zxn.kotlin.sam;

/**
 * TestKotlinSam
 * Created by zxn on 2021/2/23.
 */
public class TestJavaSam {

//    public static void main(String[] args) {
//        Callable<String> strCallable = () -> "Hello world!";
//        System.out.println(strCallable.call());
//        prints "Hello world!"
//        System.out.println("System");
//    }

//    public static void main(String[] args) {
//        buyBike(new IBuy() {
//            @Override
//            public void onBuy(double money) {
//                System.out.println("buyBike:" + money);
//            }
//        });
//        buyCar(new IBuy() {
//            @Override
//            public void onBuy(double money) {
//                System.out.println("buyCar:" + money);
//            }
//        });
//    }

    public static void main(String[] args) {
        buyBike(money -> System.out.println("buyBike:" + money));
        buyCar(money -> System.out.println("buyCar:" + money));
    }
    public static void buyBike(IBuy buy) {
        buy.onBuy(500.00);
    }
    public static void buyCar(IBuy buy) {
        buy.onBuy(50000.00);
    }
}
